﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Resehantering.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(Request.IsAuthenticated && User.IsInRole("admin"))
            {
                Response.Redirect("/Account/Register.aspx");
            }
            else if(Request.IsAuthenticated && User.IsInRole("boss"))
            {
                Response.Redirect("~/boss.aspx");
            }
            else if(Request.IsAuthenticated && User.IsInRole("member"))
            {
                Response.Redirect("~/default.aspx");
            }
            //RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        }
    }
}
